<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>
    var xhr = new XMLHttpRequest();
    xhr.open('POST', 'http://localhost:3000/json');
    var obj = {
      name: '红楼梦'
    };
    var data = JSON.stringify(obj);
    xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
    xhr.send(data);
  </script>
</body>
</html>